package tools;

import java.sql.*;

/**
 * @author :wn
 * @program : 管家婆项目
 * @descript : JDBC编程，连接数据库
 * @create :2020-06-07 11:27
 */

public class JDBCforMysql  {
    public static ResultSet query(String sql) throws SQLException{
        Connection conn=null;
        Statement stmt=null;
        ResultSet rs=null;
        try{
            conn=JDBCUtils.getConnection("jdbc:mysql://localhost:3306/users?useSSL=false");
            stmt=conn.createStatement();
            rs=stmt.executeQuery(sql);
            return rs;
        }catch (Exception e){
            e.printStackTrace();
            return  rs;
        }
    }
}
